package com.pine.common.database.annotations;

import java.lang.annotation.*;

/**
 * 数据权限组注解（一组注解中，仅有一条配置会生效，取决于当前角色的DbDataScopeEnum）<br/>
 * <pre>
 *     <code>
 *             @DataPermissionGroup({
 *             @DataPermission(dataScope = DbDataScopeEnum.ONLY_SELF, permissionFieldName = "id"),
 *             @DataPermission(dataScope = DbDataScopeEnum.DEPT, permissionFieldName = "dept_id"),
 *             @DataPermission(dataScope = DbDataScopeEnum.DEPT_WITH_CHILDREN, permissionFieldName = "dept_id")
 *     })
 *     @Select("SELECT * FROM sys_user ")
 *     List<SysUser> selectUserListWithRole(@Param("sysUser") SysUser sysUser);
 *     </code>
 * </pre>
 *
 * @author pine manage
 * @since 2024-09-26
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
public @interface DataPermissionGroup {
    DataPermission[] value();
}
